﻿using Fibot.Module.K3Cloud.BASE.dto;
using Newtonsoft.Json.Linq;
using System.Runtime.InteropServices.JavaScript;

namespace Fibot.Module.K3Cloud.STK.dto;

public class AssembledAppDto
{
}
/// <summary>
/// 组装拆卸单
/// </summary>
public class AssembledAppHeaderDto
{

    /// <summary>
    /// 实体主键
    /// </summary>
    public int FID { get; set; }

    public string FBillNo { get; set; }

    /// <summary>
    /// 单据类型
    /// </summary>
    public BaseBasicDataDto FBillTypeID { get; set; } = new BaseBasicDataDto();

    /// <summary>
    /// 库存组织
    /// </summary>
    public BaseBasicDataDto FStockOrgId { get; set; } = new BaseBasicDataDto();

    /// <summary>
    /// 事务类型
    /// </summary>
    public string FAffairType { get; set; } = "Assembly";

    /// <summary>
    /// 日期
    /// </summary>
    public DateTime FDate { get; set; } = DateTime.Now;

    /// <summary>
    /// 备注
    /// </summary>
    public string FNote { get; set; } = "";

    /// <summary>
    /// 成品货主类型
    /// </summary>
    public string FOwnerTypeIdHead { get; set; } = "BD_OwnerOrg";

    /// <summary>
    /// 成品货主
    /// </summary>
    public BaseBasicDataDto FOwnerIdHead { get; set; } = new BaseBasicDataDto();

    /// <summary>
    /// 子件货主类型
    /// </summary>
    public string FSubProOwnTypeIdH { get; set; } = "BD_OwnerOrg";

    /// <summary>
    /// 子件货主
    /// </summary>
    public BaseBasicDataDto FSubProOwnerIdH { get; set; } = new BaseBasicDataDto();

    /// <summary>
    /// 成品表
    /// </summary>
    public List<AssembledAppEntryDto> FEntity { get; set; } = new List<AssembledAppEntryDto>();
}

/// <summary>
/// 成品表
/// </summary>
public class AssembledAppEntryDto
{

    /// <summary>
    /// 物料编码
    /// </summary>
    public BaseBasicDataDto FMaterialID { get; set; } = new BaseBasicDataDto();
    /// <summary>
    /// 单位
    /// </summary>
    public BaseBasicDataDto FUnitID { get; set; } = new BaseBasicDataDto();
    /// <summary>
    /// 数量
    /// </summary>
    public decimal FQty { get; set; }
    /// <summary>
    /// 仓库
    /// </summary>
    public BaseBasicDataDto FStockID { get; set; } = new BaseBasicDataDto();
    /// <summary>
    /// 仓位
    /// </summary>
    public JArray FStockLocId { get; set; }
    /// <summary>
    /// 库存状态
    /// </summary>
    public BaseBasicDataDto FStockStatusID { get; set; } = new BaseBasicDataDto();
    /// <summary>
    /// 基本单位
    /// </summary>
    public BaseBasicDataDto FBaseUnitID { get; set; } = new BaseBasicDataDto();
    /// <summary>
    /// 备注
    /// </summary>
    public string FDescription { get; set; } = "";
    /// <summary>
    /// 货主类型
    /// </summary>
    public string FOwnerTypeID { get; set; } = "BD_OwnerOrg";
    /// <summary>
    /// 货主
    /// </summary>
    public BaseBasicDataDto FOwnerID { get; set; } = new BaseBasicDataDto();
    /// <summary>
    /// 保管者类型
    /// </summary>
    public string FKeeperTypeID { get; set; } = "BD_OwnerOrg";
    /// <summary>
    /// 保管者
    /// </summary>
    public BaseBasicDataDto FKeeperID { get; set; } = new BaseBasicDataDto();
    /// <summary>
    /// 入库日期
    /// </summary>
    public DateTime FInstockDate { get; set; }
    /// <summary>
    /// 批号
    /// </summary>
    public BaseBasicDataDto FLOT { get; set; } = new BaseBasicDataDto();
    /// <summary>
    /// 子件表
    /// </summary>
    public List<AssembledAppSubEntryDto> FSubEntity { get; set; } = new List<AssembledAppSubEntryDto>();

}

/// <summary>
/// 子件表
/// </summary>
public class AssembledAppSubEntryDto
{

    /// <summary>
    /// 物料编码
    /// </summary>
    public BaseBasicDataDto FMaterialIDSETY { get; set; } = new BaseBasicDataDto();
    /// <summary>
    /// 单位
    /// </summary>
    public BaseBasicDataDto FUnitIDSETY { get; set; } = new BaseBasicDataDto();
    /// <summary>
    /// 数量
    /// </summary>
    public decimal FQtySETY { get; set; }
    /// <summary>
    /// 仓库
    /// </summary>
    public BaseBasicDataDto FStockIDSETY { get; set; } = new BaseBasicDataDto();
    /// <summary>
    /// 仓位
    /// </summary>
    public JArray? FStockLocIdSETY;

    /// <summary>
    /// 批号
    /// </summary>
    public BaseBasicDataDto FLOTSETY { get; set; } = new BaseBasicDataDto();

    /// <summary>
    /// 库存状态
    /// </summary>
    public BaseBasicDataDto FStockStatusIDSETY { get; set; } = new BaseBasicDataDto();
    /// <summary>
    /// 基本单位
    /// </summary>
    public BaseBasicDataDto FBaseUnitIDSETY { get; set; } = new BaseBasicDataDto();
    /// <summary>
    /// 备注
    /// </summary>
    public string FDescriptionSETY { get; set; } = "";
    /// <summary>
    /// 货主类型
    /// </summary>
    public string FOwnerTypeIDSETY { get; set; } = "BD_OwnerOrg";
    /// <summary>
    /// 货主
    /// </summary>
    public BaseBasicDataDto FOwnerIDSETY { get; set; } = new BaseBasicDataDto();
    /// <summary>
    /// 保管者类型
    /// </summary>
    public string FKeeperTypeIDSETY { get; set; } = "FKeeperTypeID";
    /// <summary>
    /// 保管者
    /// </summary>
    public BaseBasicDataDto FKeeperIDSETY { get; set; } = new BaseBasicDataDto();

    /// <summary>
    /// 辅单位
    /// </summary>
    public BaseBasicDataDto FExtAuxUnitIdSETY { get; set; } = new BaseBasicDataDto();

    /// <summary>
    /// 数量 辅单位
    /// </summary>
    public decimal FExtAuxUnitQtySETY { get; set; }

    /// <summary>
    /// 库存辅单位
    /// </summary>
    public BaseBasicDataDto FSecUnitIDSETY { get; set; } = new BaseBasicDataDto();

    /// <summary>
    /// 数量 库存辅单位
    /// </summary>
    public decimal FSecQtySETY { get; set; }

}